/**
 * C Programming: A Modern Approach
 *
 * version: 2nd
 * author: K.N.King
 * http://knking.com/books/c2
 */

#include <stdio.h>

/**
 *
 */

int main(void) {
    int gs1_prefix;
    int group_identifier;
    int publisher_code;
    int item_number;
    int check_digit;

    printf("Enter ISBN: ");
    scanf("%d-%d-%d-%d-%d", &gs1_prefix, &group_identifier, &publisher_code,
          &item_number, &check_digit);

    printf("GS1 prefix: %d\n", gs1_prefix);
    printf("Group identifier: %d\n", group_identifier);
    printf("Publisher code: %d\n", publisher_code);
    printf("Item number: %d\n", item_number);
    printf("Check digit: %d\n", check_digit);

    return 0;
}

/*
output:
Enter ISBN: 978-0-393-97950-3
GS1 prefix: 978
Group identifier: 0
Publisher code: 393
Item number: 97950
Check digit: 3
*/